import axios from '@/axios'
// 优惠券列表
export const getCouponListAPI = (page) => {
  return axios.get(`/admin/coupon/${page}`)
}

// 增加优惠券
export const addCouponAPI = (data) => {
  return axios.post('/admin/coupon', data)
}

// 修改优惠券
export const updateCouponAPI = (id, data) => {
  return axios.post(`/admin/coupon/${id}`, data)
}

// 删除优惠券
export const deleteCouponAPI = (id) => {
  return axios.post(`/admin/coupon/${id}/delete`)
}

// 失效优惠券
export const updateCouponStatus = (id) => {
  return axios.post(`/admin/coupon/${id}/update_status`, {
    status: 0,
  })
}
